-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change FD_SETSIZE
to c_int
#3356
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
☔ The latest upstream changes (presumably #3348) made this pull request unmergeable. Please resolve the merge conflicts. |
41a44a0
to
ac2eefa
Compare
Please also update |
ac2eefa
to
a65f368
Compare
Rebased and updated my commit. I also changed |
☔ The latest upstream changes (presumably #3428) made this pull request unmergeable. Please resolve the merge conflicts. |
Ah, sorry, my commit indeed modified a lot, up to conflicting yours. |
a65f368
to
500365e
Compare
No problem, my diff is so small that the conflict can be easily resolved 🙂 |
@bors r+ |
☀️ Test successful - checks-actions, checks-cirrus-freebsd-13, checks-cirrus-freebsd-14 |
FD_SETSIZE
defines an upper bound for file descriptors that can be added tofd_set
. It is common to check if a file descriptor is less thanFD_SETSIZE
before adding it to anfd_set
. See the example below:Unfortunately, this example does not compile because of a type mismatch.
fd
isc_int
whileFD_SETSIZE
isusize
(orsize_t
).Since
FD_SETSIZE
represents the max file descriptor + 1, I think it should have the same type as file descriptors. This pull request modifies the type toc_int
and adds casts where needed.